<template>
	<!-- 调用组件 -->
	<div>
	<home-header></home-header>
	<home-swiper :swiperList='swiperList'></home-swiper>
	<home-icon :iconlist='iconlist'></home-icon>
	<home-week :WeekList='WeekList'></home-week>
	<home-foot></home-foot>
	</div>
	
</template>

<script>
	//引入Heder.vue
	import HomeHeader from './pages/Header'
	import HomeSwiper from './pages/Swiper'
	import HomeIcon from './pages/Icon'
	import HomeWeek from './pages/Week.vue'
	import HomeFoot from './pages/Foot.vue'
	
	import axios from 'axios'
	//导出组件HomeHeader
	export default{
		components:{
			HomeHeader,
			HomeSwiper,
			HomeIcon,
			HomeWeek,
			HomeFoot
		},
		data(){
			return{
				WeekList:[],
				iconlist:[],
				swiperList:[],
			}
		},
		mounted(){
			axios.get('./dataHome.json').then((res)=>{
				const msg = res.data.data[0];//声明变量获取请求结果里面的数据
				//空数组获取组件数组数据
				this.WeekList = msg.WeekList;
				this.iconlist = msg.iconlist;
				this.swiperList = msg.swiperList;
				console.log(msg.iconlist)
			})
		}
	}
</script>

<style>
</style>
